﻿CREATE TABLE [dbo].[Employee_Wage] (
    [Id]                 INT              IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [GId]                UNIQUEIDENTIFIER CONSTRAINT [DF_Employee_Wage_GId] DEFAULT (newid()) ROWGUIDCOL NULL,
    [UserName]           NVARCHAR (50)    NULL,
    [EName]              NVARCHAR (50)    NULL,
    [CompanyId]          INT              CONSTRAINT [DF_Employee_Wage_CompanyId] DEFAULT ((0)) NULL,
    [DepartmentId]       INT              CONSTRAINT [DF_Employee_Wage_DepartmentId] DEFAULT ((0)) NULL,
    [DepName]            NVARCHAR (50)    NULL,
    [ZhiWu]              NVARCHAR (50)    NULL,
    [GradeId]            INT              CONSTRAINT [DF_Employee_Wage_GradeId] DEFAULT ((0)) NULL,
    [GradeName]          NVARCHAR (50)    NULL,
    [PostCategoryId]     INT              CONSTRAINT [DF_Employee_Wage_PostCategoryId] DEFAULT ((0)) NULL,
    [PostCategoryName]   NVARCHAR (50)    NULL,
    [PostId]             INT              CONSTRAINT [DF_Employee_Wage_PostName] DEFAULT ((0)) NULL,
    [PostName]           NVARCHAR (50)    NULL,
    [ChuQinDays]         FLOAT (53)       CONSTRAINT [DF_Employee_Wage_ChuQinDays] DEFAULT ((0)) NULL,
    [BasicWage]          NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_BasicWage] DEFAULT ((0)) NULL,
    [PostWage]           NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_PostWage] DEFAULT ((0)) NULL,
    [WorkWage]           NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_WorkWage] DEFAULT ((0)) NULL,
    [Jxyuan]             NUMERIC (18, 2)  NULL,
    [Jxkou]              NUMERIC (18, 2)  NULL,
    [JxWage]             NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_JxWage] DEFAULT ((0)) NULL,
    [FAllowance]         NUMERIC (18, 2)  NULL,
    [LSwance]            NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_LSwance] DEFAULT ((0)) NULL,
    [ZBwance]            NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_ZBwance] DEFAULT ((0)) NULL,
    [Allowance]          NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_Allowance] DEFAULT ((0)) NULL,
    [ManQin]             NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_ManQin] DEFAULT ((0)) NULL,
    [XSTC]               NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_XSTC] DEFAULT ((0)) NULL,
    [XFTC]               NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_XFTC] DEFAULT ((0)) NULL,
    [BLTC]               NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_BLTC] DEFAULT ((0)) NULL,
    [FixedAllowance]     NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_FixedAllowance] DEFAULT ((0)) NULL,
    [QtAllowance]        NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_QtAllowance_1] DEFAULT ((0)) NULL,
    [TiCheng]            NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_TiCheng] DEFAULT ((0)) NULL,
    [MTiCheng]           NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_MTiCheng] DEFAULT ((0)) NULL,
    [YjBonus]            NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_YjBonus] DEFAULT ((0)) NULL,
    [LsBonus]            NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_LsBonus] DEFAULT ((0)) NULL,
    [ChuQinKouKuan]      NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_ChuQinKouKuan] DEFAULT ((0)) NULL,
    [BxKouKuan]          NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_BxKouKuan] DEFAULT ((0)) NULL,
    [GJJKouKuan]         NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_GJJKouKuan] DEFAULT ((0)) NULL,
    [ChiDaoKouKuan]      NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_ChiDaoKouKuan] DEFAULT ((0)) NULL,
    [YJKouKuan]          NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_YeJiKouKuan] DEFAULT ((0)) NULL,
    [OtherKouKuan]       NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_QiTaKouKuan] DEFAULT ((0)) NULL,
    [GRSDSKouKuan]       NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_GRSDSKouKuan] DEFAULT ((0)) NULL,
    [YFHeJi]             NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_YFHeJi] DEFAULT ((0)) NULL,
    [DFHeJi]             NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_DFHeJi] DEFAULT ((0)) NULL,
    [HeJiWage]           NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_HeJiWage_1] DEFAULT ((0)) NULL,
    [FaFangMonth]        NVARCHAR (50)    NULL,
    [CreateName]         NVARCHAR (50)    NULL,
    [CreateDate]         DATETIME         NULL,
    [HRFlag]             INT              NULL,
    [HRFlagDate]         DATETIME         NULL,
    [FinanceFlag]        INT              NULL,
    [FinanceFlagDate]    DATETIME         NULL,
    [FinanceFlag_DF]     INT              CONSTRAINT [DF_Employee_Wage_FinanceFlag_DF_1] DEFAULT ((1)) NULL,
    [FinanceFlagDate_DF] DATETIME         NULL,
    [FinanceFlagUser_DF] NVARCHAR (20)    NULL,
    [StateId]            INT              NULL,
    [Guid_str]           NVARCHAR (200)   NULL,
    [WageCardNo]         VARCHAR (200)    CONSTRAINT [DF_Employee_Wage_WageCardNo] DEFAULT ('') NULL,
    [Deduction]          NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_Deduction_1] DEFAULT ((0)) NULL,
    [bxje]               NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_bxje] DEFAULT ((0)) NULL,
    [msje]               NUMERIC (18, 2)  CONSTRAINT [DF_Employee_Wage_msje] DEFAULT ((0)) NULL,
    CONSTRAINT [PK_Employee_Wage] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_Wage_CompanyId]
    ON [dbo].[Employee_Wage]([CompanyId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_Wage_DeptID]
    ON [dbo].[Employee_Wage]([DepartmentId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_Wage_FaFangMonth]
    ON [dbo].[Employee_Wage]([FaFangMonth] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_Wage]
    ON [dbo].[Employee_Wage]([UserName] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_Wage_GId]
    ON [dbo].[Employee_Wage]([GId] ASC);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_Employee_Wage_2d799211ab9248dfac75ec6979470aa0]
    ON [dbo].[Employee_Wage]([CompanyId] ASC, [HRFlag] ASC, [StateId] ASC)
    INCLUDE([DepartmentId], [FaFangMonth]);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'固定补助', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'FAllowance';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'临时补助', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'LSwance';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'值班补助', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'ZBwance';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'销售提成', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'XSTC';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'续费提成', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'XFTC';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'补录提成', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'BLTC';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'其他补助', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'QtAllowance';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'个人公积金扣款', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'GJJKouKuan';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'个税', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'GRSDSKouKuan';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'应付合计', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'YFHeJi';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'待付合计', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'DFHeJi';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'合计最终 审核之后 工资金额', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'HeJiWage';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'财务发放待付工资(1:未发放。2：已发放)', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'FinanceFlag_DF';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'财务发放待付工资日期', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'FinanceFlagDate_DF';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'财务审核人员', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'FinanceFlagUser_DF';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'此GUID 只是标示 当前单位当前月份的 批量操作标示 不针对每条记录', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'Guid_str';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'工资扣款', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'Deduction';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'报销金额2015.03.26', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'bxje';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'其他（免税金额）2015.03.26', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee_Wage', @level2type = N'COLUMN', @level2name = N'msje';

